package com.example.newnoke.mvp.presenter;

import com.example.newnoke.data.BaseDatas;
import com.example.newnoke.data.HongLiData;
import com.example.newnoke.data.ZhuanRuData;
import com.example.newnoke.mvp.view.ITestV;
import com.example.newnoke.utils.GsonUtil;
import com.geya.jbase.mvp.presenter.BasePresenter;

public class TestPresenter extends BasePresenter<ITestV> {

    public TestPresenter(ITestV mvpView) {
        super(mvpView);
    }

    @Override
    public void serverResponseObj(Object o) {

        if (o instanceof HongLiData){
            getView().getDatas(GsonUtil.GsonString(((HongLiData) o).getData()),"");
        } if (o instanceof ZhuanRuData) {
            getView().getDatas(((ZhuanRuData) o).getData().getLast_amount(),"zhuan");
        } else if (o instanceof BaseDatas){
            getView().getDatas(((BaseDatas) o).getMessage(),"");
        }
    }
}
